//button按钮方法
function createButton(x, y, width, height, bgColor, text, textColor) {
    var button = new egret.DisplayObjectContainer();
    button.x = x;
    button.y = y;
    button.width = width;
    button.height = height;
    var shape = new egret.Shape();//形状对象 
    shape.graphics.beginFill(bgColor);
    shape.graphics.drawRoundRect(0, 0, width, height, height, height);
    shape.graphics.endFill();
    button.addChild(shape);
    var shape_text = new egret.TextField();
    shape_text.text = text;
    shape_text.width = shape.width;
    shape_text.height = shape.height;
    shape_text.textColor = textColor;
    shape_text.textAlign = "center";
    shape_text.verticalAlign = "middle";
    button.addChild(shape_text);
    return button;
}